{include file='_header'}
<style>
    .input-group-sm .btn {padding: 4px 6px;}
    .trhead {border-left: 1px solid #e7eaec; border-right: 1px solid #e7eaec; background:#f8f8f8;}
    .trhead.bottom {border-bottom: 1px solid #e7eaec;}
    .trbody {border-bottom: 1px solid #e7eaec; border-right: 1px solid #e7eaec;}
    .trbody td {border-left: 1px solid #e7eaec;}
    .popover {font-family: '微软雅黑'; font-size: 12px;}
    .label {padding: 3px 5px;}
</style>

<div class="page-header">
    当前位置：<span class="text-primary">评价管理 </span>
</div>
<div class="page-content">
    <form action="" method="get" class="form-horizontal form-search" role="form">
        <div class="page-toolbar m-b-sm m-t-sm">
            <div class="col-sm-6">
                <div class='input-group input-group-sm'  style='float:left;'  >
                    {:tpl_daterange('time', array('sm'=>true,'placeholder'=>'请选择评论时间'),true);}
                </div>
            </div>
            <div class="col-sm-6 pull-right">
                <div class="input-group">
                    <div class="input-group-select">
                        <select name='replystatus' class='form-control ' style="width: 120px; padding: 0 6px;">
                            <option value='0' {if $replystatus==''}selected{/if}>评论状态</option>
                            <option value='1' {if $replystatus=='1'}selected{/if}>首评待审核</option>
                            <option value='2' {if $replystatus=='2'}selected{/if} >追评待审核</option>
                            <option value='2' {if $replystatus=='3'}selected{/if}>首评待回复</option>
                            <option value='4' {if $replystatus=='4'}selected{/if} >追评待回复</option>
                        </select>
                    </div>
                    <div class="input-group-select">
                        <select name='virtual' class='form-control' style="padding: 0 6px;">
                            <option value='' {if $virtual==''}selected{/if}>评论类型</option>
                            <option value='1' {if $virtual=='1'}selected{/if} >真实评价</option>
                            <option value='0' {if $virtual=='0'}selected{/if}>模拟评价</option>
                        </select>
                    </div>
                    <input type="text" class=" form-control" name='keyword' value="{$keyword}" placeholder="参与记录/商品"> <span class="input-group-btn">
                        <button class="btn btn-primary" type="submit"> 搜索</button> </span>
                </div>
            </div>
        </div>
    </form>

    {if empty($list)}
        <div class="panel panel-default">
            <div class="panel-body" style="text-align: center;padding:30px;">
                未查询到相关评价!
            </div>
        </div>
    {else}
        <div class="page-table-header">
            <input type="checkbox" name="" id="">
            <div class="btn-group">
                <button class="btn btn-default btn-sm dropdown-toggle btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{:webUrl('shop/comment/delete')}">
                    <i class='icow icow-shanchu1'></i> 删除</button>
            </div>
        </div>
        <table class="table table-hover table-responsive">
            <thead>
            <tr class="trhead">
                <th style="width: 250px;">商品信息</th>
                <th>评价人</th>
                <th style="text-align: center;">评分等级</th>
                <th style="text-align: center;">评价状态</th>
                <th style="text-align: center;">回复状态</th>
                <th style="text-align: center;">审核状态</th>
                <th style="text-align: center;">时间</th>
                <th style="width: 115px; text-align: center;">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr style=" background: none;">
                <td colspan="8" style="height:20px;padding:0;border-top:none;"></td>
            </tr>
            {foreach name='list' item='item'}
            <tr class="trhead">
                <td colspan="7"><input type="checkbox" value="109"> {if empty($item['virtual'])}参与记录编号: {$item['logno']}{else}虚拟评价{/if}</td>
                <td colspan="1" style="text-align: right;">
                    {if empty($item['virtual']) && ($item['checked']<1 || ($item['append_checked']<1) && (!empty($item['append_content'])||!empty($item['append_images'])))}
                        <label class="label label-default">待审核</label>
                    {/if}
                </td>
            </tr>
            <tr class="trbody">
                <td data-toggle="tooltip" title="" data-original-title="{$item['title']}">
                    <a href="{:webUrl('creditshop/goods/edit', array('id'=>$item['goodsid']))}" target="_blank">
                        <img src="{:tomedia($item['thumb'])}" style="width:30px; height:30px; border:1px solid #ccc;" onerror="this.src='../addons/ewei_shopv2/static/images/nopic.png'"> {$item['title']}
                    </a>
                </td>
                <td data-toggle="tooltip" title="" data-original-title="{$item['niackname']}">
                    {if !empty($item['mid'])}<a href="{:webUrl('member/list/detail', array('id'=>$item['mid']))}" target="_blank">{/if}
                    <img src="{:tomedia($item['headimg'])}" style="width:30px; height:30px; border:1px solid #ccc;" onerror="this.src='../addons/ewei_shopv2/static/images/nopace.png'"/> {$item['nickname']}
                    {if !empty($item['mid'])}</a>{/if}
                </td>
                <td style="text-align: center;">
                    <label class="label label-danger">{$item['level']} 颗星</label>
                </td>
                <td style="text-align: center; padding: 5px;">
                    {if !empty($item['append_content'])}
                        <span class='text-warning'>追加评价</span>
                    {else}
                        <span class='text-default'>首次评价</span>
                    {/if}
                </td>
                <td style="text-align: center;">
                    {if !empty($item['reply_content']) || !empty($item['reply_images'])}
                         <span class="text-danger">首评已回复</span>
                    {else}
                         <span class='text-default'>首评待回复</span>
                    {/if}
                    {if !empty($item['append_content']) || !empty($item['append_images'])}
                        <br>
                        {if !empty($item['append_reply_content']) || !empty($item['append_reply_content'])}
                            <span class="text-danger">追评已回复</span>
                        {else}
                            <span class='text-default'>追评待回复</span>
                        {/if}
                    {/if}
                </td>
                <td style="text-align: center;">
                    {if empty($item['virtual'])}
                        {if empty($item['checked'])}
                            <span class="text-default">首次评价待审核</span>
                        {elseif $item['checked']==1}
                            &nbsp;<span class="text-success">首次评价通过</span>
                        {else}
                            &nbsp;<span class="span-danger">首次评价不通过</span>
                        {/if}
                        {if !empty($item['append_content'])}
                            <br>
                            {if empty($item['append_checked'])}
                                <span class="text-default">追加评价待审核</span>
                            {elseif $item['append_checked']==1}
                                <span class="text-success">追加评价通过</span>
                            {else}
                                <span class="text-danger">追加评价不通过</span>
                            {/if}
                        {/if}
                    {else}
                        虚拟评价
                    {/if}
                </td>
                <td class="text-center">
                    <a data-toggle="popover" data-html="true" data-placement="right"  data-trigger="hover" data-content="
                        {if !empty($item['time'])}首评时间: {:date('Y-m-d H:i:s', $item['time'])}<br>{/if}
                        {if !empty($item['reply_time'])}首评回复: {:date('Y-m-d H:i:s', $item['reply_time'])}<br>{/if}
                        {if !empty($item['append_time'])}追评时间: {:date('Y-m-d H:i:s', $item['append_time'])}<br>{/if}
                        {if !empty($item['append_reply_time'])}追评回复: {:date('Y-m-d H:i:s', $item['append_reply_time'])}{/if}
                    " data-trigger="focus" tabindex="0" role="button" data-original-title="" title="">查看 <i class="fa fa-question-circle"></i></a>
                </td>
                <td class="text-center">
                    <a class="text-primary" href="{:webUrl('creditshop/comment/edit', array('id'=>$item['id']))}" title="编辑">
                             {if !empty($item['virtual'])}编辑
                        {else}
                            {if $item['checked']<1||$item['append_checked']<1}审核
                            {elseif empty($item['reply_content'])||((!empty($item['append_content'])||!empty($item['append_images']))&&empty($item['append_reply_content']))}回复评价
                            {else}查看
                            {/if}
                        {/if}
                    </a>
                    <br/>
                    <a class="text-primary" data-toggle="ajaxRemove" href="{:webUrl('creditshop/comment/delete', array('id'=>$item['id']))}" data-confirm="确认删除此评价吗？">
                        删除评价
                    </a>
                </td>
            </tr>
            <tr style=" background: none;">
                <td colspan="8" style="height:20px;padding:0;border-top:none;"></td>
            </tr>
            {/foreach}
            </tbody>
        </table>
    {/if}
</div>


{include file='_footer'}